<%@ page import="cn.fldong.employee.entity.EmployeeEntity" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>极客协会员工信息管理系统</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- 导航栏 -->
<jsp:include page="head.jsp" />
<main>
    <h1>员工信息列表</h1>
    <form>
        <table>
        <!-- 循环遍历学生列表，显示学生信息 -->
        <%
            List<EmployeeEntity> employees = (List<EmployeeEntity>) request.getAttribute("employees");
            if (employees == null || employees.isEmpty()) {
        %>
        <tr>
            <td colspan="4">暂无员工信息</td>
        </tr>
        <%
                return;
            }
            %>
        <tr>
            <th>工号</th>
            <th>姓名</th>
            <th>性别</th>
            <th>年龄</th>
            <th>部门</th>
            <th>职位</th>
            <th>入职日期</th>
            <th>工资</th>
        </tr>
        <%
            for (EmployeeEntity employee : employees) {
        %>
        <tr>
            <td><%=employee.getEmpID()%></td>
            <td><%=employee.getEmpName()%></td>
            <td><%=employee.getEmpGender()%></td>
            <td><%=employee.getEmpAge()%></td>
            <td><%=employee.getEmpDepartment()%></td>
            <td><%=employee.getEmpPosition()%></td>
            <td><%=employee.getEmpHireDate()%></td>
            <td><%=employee.getEmpSalary()%></td>
        </tr>
        <%
            }
        %>
    </table>
    <input type="button" value="返 回" onclick="history.go(-1)" style="width: 200px; height: 45px; padding: 10px; background-color: #4CAF50; color: white; border: none; border-radius: 10px; cursor: pointer; float: right; margin-right: 20px;"/>
    </form>
    <br>
</main>
<!-- 登录信息 -->
<jsp:include page="foot.jsp" />
</body>
</html>